home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / rettig.arc / TRSOURCE.EXE / LASTDRIV.C < prev    next >
C/C++ Source or Header  |  1990-10-22  |  862b  |  42 lines

  1. /*********
  2. *
  3. *  LASTDRIV.C
  4. *
  5. *  by Ralph Davis
  6. *  modified by Tom Rettig, Leonard Zerman
  7. *
  8. * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
  9. *
  10. *  Syntax:  LASTDRIVE()
  11. *  Return:  <expC> indicating lastdrive on LASTDRIVE= line in CONFIG.SYS
  12. *********/
  13.  
  14. #include "trlib.h"
  15.  
  16. TRTYPE lastdrive()
  17. {
  18.    char *confparm = "LASTDRIVE";
  19.    static char drivestr[3];
  20.    int temp;
  21.  
  22.    /* _tr_doscnf can return either a char value or an int error code */
  23.    temp = (int) _tr_doscnf(confparm);
  24.    switch ( temp )
  25.    {
  26.       case -1:
  27.          drivestr[0] = '-';
  28.          drivestr[1] = '1';
  29.          break;
  30.       case 0:
  31.          drivestr[0] = '0';
  32.          drivestr[1] = NULLC;
  33.          break;
  34.       default:
  35.          drivestr[0] = temp;
  36.          drivestr[1] = NULLC;
  37.    }
  38.    drivestr[2] = NULLC;
  39.    _retc(drivestr);
  40. }
  41.  
  42.